﻿package 
{
	import flash.events.*;
	
	public class Script{
		
		var player:Player=new Player();
		
		public function keyDownProc(e:KeyboardEvent){
			switch(String.fromCharCode(e.charCode))
			{
				case 'a':
				player.walkLeft();
				break;
				case 'd':
				player.walkRight();
				break;
			}
		}
		
		public function keyUpProc(e:KeyboardEvent){
			switch(String.fromCharCode(e.charCode))
			{
				case 'a':
				if(player.getState()=="walkLeft")player.stand();
				break;
				case 'd':
				if(player.getState()=="walkRight")player.stand();
				break;
			}
		}
		
	}
}